﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

using Sita.MainModule.Services;
using Sita.Entities;
using Sita.Presentation.ViewModels;

namespace Sita.Presentation.Controllers
{
    public class DashboardController : DefaultController
    {
        public ActionResult Index()
        {
            return View();
        }

        public PartialViewResult LowStockList()
        {
            ReplacementService replacementService = new ReplacementService();
            int CurrentBusinessUnitID = this.AuthenticatedUser.Business[this.AuthenticatedUser.CurrentBusinessUnitIndex].BusinessUnitID;
            List<Replacement> Replacements = null;
            Replacements = replacementService.GetLowStockReplacements(CurrentBusinessUnitID).ToList();
            return PartialView(Replacements);
        }

        public PartialViewResult NoStockList()
        {
            ReplacementService replacementService = new ReplacementService();
            int CurrentBusinessUnitID = this.AuthenticatedUser.Business[this.AuthenticatedUser.CurrentBusinessUnitIndex].BusinessUnitID;
            IList<Replacement> Replacements = null;
            Replacements = replacementService.GetOutOfStockReplacements(CurrentBusinessUnitID);
            return PartialView(Replacements);
        }

    }
}
